package com.example.mybatisdemo.Service;

import com.example.mybatisdemo.dao.UserMapper;
import com.example.mybatisdemo.model.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-08-11
 * Time: 17:48
 */
@Service
public class UserService {
    @Resource
    private UserMapper userMapper;
    public List<User> getAll() {
        return userMapper.getAll();
    }
    public Integer add(User user ){
        return userMapper.add(user);
    }
   public  Integer update(Integer id, String name){
        return userMapper.update(id,name);
   }
  public Integer delById(Integer id){
        return userMapper.delById(id);
  }
  public User getUserById(Integer id){
        return userMapper.getUserById(id);
  }
  public Integer insert(User user ){
        return userMapper.insert(user);
  }
  public List<User> selectByCondition(User user){
        return userMapper.selectByCondition(user);
  }
    public int updateById(User user){
        return userMapper.updateById(user);
    }
    public int deleteByIds(List<Integer> ids){
        return  userMapper.deleteByIds(ids);
    }
}
